package com.lsmw.applet.controller;

import com.alibaba.nacos.api.annotation.NacosInjected;
import com.lsmw.applet.client.MyTransferClient;
import com.lsmw.commonutils.R;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/*
 *ClassName:EduOssTransfer
 *UserName:二号男嘉宾
 *CreateTime:2021/1/5 11:24
 */
@RestController
@RequestMapping("/applet")
public class HotelTransferController {

    private MyTransferClient hotelClient;

    @NacosInjected
    public HotelTransferController(MyTransferClient hotelClient) {
        this.hotelClient = hotelClient;
    }

    @GetMapping("/hotel")
    public R getHotelList() {
        return hotelClient.getHotelList();
    }

    @GetMapping("/room/{id}")
    public R getRoomListByHotelId(
                @ApiParam(name = "id", value = "酒店id", required = true)
                @PathVariable("id") String id) {
        return hotelClient.getRoomListByHotelId(id);
    }

}
